//
//  CycleImageView.m
//  SBooks
//
//  Created by shansander on 2016/11/29.
//  Copyright © 2016年 shansander. All rights reserved.
//

#import "CycleImageView.h"
#import <Masonry.h>

@implementation CycleImageView

- (id)init
{
    self = [super init];
    if (self) {
        [self configView];
    }
    return self;
}

- (void)configView{
    
    [self setBackgroundColor:[UIColor clearColor]];
    
    theRootImage = [[UIImageView alloc] init];
    [self addSubview:theRootImage];
    
    [theRootImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset = 0;
        make.left.offset = 0;
        make.right.offset = 0;
        make.bottom.offset = 0;
    }];
    
}
- (void)displayImage:(UIImage * )image
{
    theRootImage.image = image;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
